{include file="common/head"/}
<div class="admin-main layui-anim layui-anim-upbit">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>{:lang('user')}{:lang('list')}</legend>
    </fieldset>
    <div class="demoTable">
        <div class="layui-inline">
            <input class="layui-input" name="key" id="key" placeholder="{:lang('pleaseEnter')}关键字">
        </div>
        <button class="layui-btn" id="search" data-type="reload">搜索</button>
        <a href="{:url('vip')}" class="layui-btn">显示全部</a>
        <!-- <button type="button" class="layui-btn layui-btn-danger" id="delAll">批量删除</button> -->
    </div>
    <table class="layui-table" id="list" lay-filter="list"></table>
</div>
<script type="text/html" id="action">
    <!-- <a href="{:url('edit')}?id={{d.id}}" class="layui-btn layui-btn-xs">编辑</a> -->
    <!-- <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> -->
</script>
<!-- <script type="text/html" id="email">
    {{d.email}}
    {{# if(d.email && d.email_validated=='0'){ }}
    (未验证)
    {{# } }}
</script> -->
{include file="common/foot"/}
<script>
    layui.use(['table','form'], function() {
        var table = layui.table,form = layui.form, $ = layui.jquery;
        var tableIn = table.render({
            id: 'user',
            elem: '#list',
            url: '{:url("vip")}',
            method: 'post',
            page: true,
            cols: [[
                {checkbox:true,fixed: true},
                {field: 'id', align: 'center', title: '{:lang("id")}', width: 80, fixed: true},
                {field: 'username', align: 'center',title: '{:lang("username")}', width: 120},
                {field: 'invite_code', align: 'center',title: '邀请码', width: 100},
                {field: 'address', align: 'center',title: '{:lang("地址")}', width: 250,templet:'#address'},
                {field: 'phone', align: 'center',title: '{:lang("手机号码")}', width: 150},
                {field: 'wx_number', align: 'center',title: '{:lang("微信号")}', width: 120},
                {field: 'register_time',align: 'center', title: '注册时间', width: 150},
                {field: 'commission', title : '佣金', width: 110, align:'center'}
            ]],
            limit: 10 //每页默认显示的数量
        });
        //搜索
        $('#search').on('click', function() {
            var key = $('#key').val();
            if($.trim(key)==='') {
                layer.msg('{:lang("pleaseEnter")}关键字！',{icon:0});
                return;
            }
            tableIn.reload({
                where: {key: key}
            });
        });
    });
</script>
</body>
</html>